<h2>Avatar Tools</h2>
<?php if( count($this->navigation) ): ?>
  <div class='tabs'>
    <?php

      echo $this->navigation()->menu()->setContainer($this->navigation)->render()
    ?>
  </div>
<?php endif; ?>
<div class="avatar_setting">
<?php if (!count($this->collections)):?>
<?php echo $this->translate('No collections were found.') .
           $this->htmlLink(array('route' => 'admin_default', 'module' => 'avatar', 'controller' => 'avatarcollection', 'action' => 'new-collection'),
                           $this->translate('Add Collection'), array('class' => 'smoothbox buttonlink')
                           ) ?>
<?php else: ?>
<?php
    $script = "window.addEvent('load', function() {
                  new Tips($$('.avatarcollection'));
                 });";
    $this->headScript()->appendScript($script, $type = 'text/javascript', $attrs = array());
?>
    <?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'avatar', 'controller' => 'avatarcollection', 'action' => 'new-collection'), $this->translate('Add Collection'), array(
      'class' => 'smoothbox buttonlink',
      'style' => 'background-image: url(application/modules/Avatar/externals/images/admin/add_collection.png);')) ?>
<div style="height:10px"></div>	  
<ul class="admin_menus_items" style="float:left">
    <?php foreach ($this->collections as $collection): ?>
	<li class="admin_menus_item">
	<span class="item_wrapper">

	
    <span class="item_options">
    <?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'avatar', 'controller' => 'avatarcollection', 'action' => 'new-collection', 'collection_id' => $collection->avatarcollection_id), 'edit', array('class' => 'smoothbox')) ?>
    |
    <?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'avatar', 'controller' => 'avatarcollection', 'action' => 'delete', 'collection_id' => $collection->avatarcollection_id), 'delete', array('class' => 'smoothbox')) ?>
    </span>
	
	<span class="item_label">
    <?php if (trim($collection->description)) echo "<span class='avatarcollection' title=\"" .  ereg_replace("(\r\n|\n|\r)", "<br/>", $collection->description) . "\" >" ?>
    <a id="collection_<?php echo $collection->avatarcollection_id ?>" style='font-weight:700' href="<?php echo $this->url(array('module'=>'avatar','controller'=>'avatarcollection','action'=>'browse', 'collection_id' => $collection->avatarcollection_id), 'admin_default') ?>" ><?php echo $collection->name ?></a> <span>(<?php echo $collection->count_avatars ?>)</span>
    <?php if (trim($collection->description)) echo "</span>" ?>
	</span>
	
	</span>
	</li>
    <?php endforeach;?>
</ul> 
  



<div class='clear'></div>

<div style="float: left;margin-left: 10px; width:735px; margin-top:-30px;">
    <h2><?php echo $this->current_collection->name ?></h2>
    <p><?php echo $this->current_collection->description ?></p>
    <?php if ($this->current_collection->count_avatars == 0):?>
    <p style="padding-bottom: 13px"><?php echo $this->translate('There are no avatar images in this collection.') ?></p>
    <?php else :?>
    <?php foreach ($this->avatars as $avatar) :?>
    <div class="avatar_box">
	<span><?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'avatar', 'controller' => 'avatarcollection', 'action' => 'delete-avatar', 'avatar_id' => $avatar->avatar_id), $this->translate(''), array(
                                         'class' => 'smoothbox buttonlink',
                                         'style' => 'background-image: url(application/modules/Avatar/externals/images/admin/delete.png);')) ?></span> 
        <img src="<?php echo $this->baseUrl() . '/application/modules/Avatar/externals/avatarcollections/' . $avatar->avatarcollection_id . '/' . 'avatar_' . $avatar->avatar_id . '.' . $avatar->extension ?>" alt="Avatar"/>
          
    </div>
    <?php endforeach; ?>
    <?php endif; ?>
    <div style="clear:both;"></div>
    <?php echo $this->form->render($this) ?>
</div>
<?php endif; ?>
</div>
